// @include "../code/Browser.js"
// @include "../code/Type.js"
// @include "../code/Class.js"
// @include "../extend/Debug.js"
// @include "../code/Event.js"
// @include "../aop/Aop.js"
// @include "../OnReady.js"

window.qinglan = window.qinglan || {};
qinglan.Test = qinglan.Test || {};
qinglan.Test.click = function(event) {
	qinglan.Debug.info(qinglan.Event.getMousePosition(event));
	qinglan.Debug.info('click function');
};
qinglan.onReady(function() {
			qinglan.Debug.info('1');
		});
qinglan.onReady(function() {
			qinglan.Debug.info('2');
		});
qinglan.onReady(function() {
			qinglan.Debug.info('3');
		});
qinglan.onReady(function() {
			qinglan.Debug.info('4');
		});
qinglan.onReady(function() {
			var node = document.getElementById('node');
			qinglan.Event.click(node, qinglan.Test.click);
		});
qinglan.onReady(function() {
			var obj = qinglan.Class.module('qinglan.ajax.xhr.post', function() {
						return {
							constructor : function() {
								this.name = 'post';
							},
							init : function() {
								console.log('init');
							},
							a : 'a',
							b : 'b'
						};
					}, {
						isExe : true,
						isStatic : false,
						getIsExe : function() {
							return this.isExe;
						}
					});
			console.log(obj);
			var ob = qinglan.Class.module('qinglan.ajax.xhr.get', {
						constructor : function(name) {
							// this.name = 'get';
							this.name = name;
						},
						init : function() {
							console.log('init');
						},
						a : 'a',
						b : 'b'
					}, {
						isStatic : true
					});
			console.log(ob);
		});
// AOP 测试
function test(name) {
	console.log('test');
	return true;
}
function advice() {
	console.log('advice');
	return true;
}
function advice1(name) {
	console.log('advice1');
	console.log('the arguments form test is ' + name);
	return 'wxq';
}
function advice2() {
	console.log('advice2');
	return true;
}
function advice3() {
	console.log('advice3');
	return true;
}
qinglan.Aop.before('test', advice);
qinglan.Aop.before('test', advice1, qinglan.Aop.ALLOW_MODE_OUT,
		function(value) {
			console.log('the return value form advice1 is ' + value);
			return value == 'wxq';
		});
qinglan.Aop.before('test', advice2, qinglan.Aop.ALLOW_MODE_IN, 'wxq');
qinglan.Aop.addAdvice('test', advice3, qinglan.Aop.ALLOW_DIRECTION_AFTER,
		qinglan.Aop.ALLOW_MODE_OUT, true);

test('qinglan');